package routers

import (
	"057dg/controllers"
	_ "057dg/models"
	"github.com/astaxie/beego"
)

func init() {
	home := beego.NewNamespace("/home",
		beego.NSRouter("/", &controllers.HomeController{}, "*:Get"),
		beego.NSRouter("/login", &controllers.HomeController{}, "*:Login"),
		beego.NSRouter("/register", &controllers.HomeController{}, "*:Register"),
		beego.NSRouter("/checkEmail", &controllers.HomeController{}, "*:CheckEmail"),
		beego.NSRouter("/active", &controllers.HomeController{}, "*:Active"),
	)
	beego.AddNamespace(home)

	job := beego.NewNamespace("/job",
		beego.NSRouter("/", &controllers.JobController{}, "*:Get"),
		beego.NSRouter("/detail", &controllers.JobController{}, "*:Detail"),
	)
	beego.AddNamespace(job)

	company := beego.NewNamespace("/company",
		beego.NSRouter("/", &controllers.CompanyController{}, "*:Get"),
		beego.NSRouter("/detail", &controllers.CompanyController{}, "*:Detail"),
	)
	beego.AddNamespace(company)

	accountUser := beego.NewNamespace("/auser",
		beego.NSRouter("/", &controllers.AccountUserController{}, "*:Get"),
		//beego.NSRouter("/post", &controllers.AccountUserController{}, "*:Post"),
		beego.NSRouter("/resume", &controllers.AccountUserController{}, "*:Resume"),
		beego.NSRouter("/editavatar", &controllers.AccountUserController{}, "*:Editavatar"),
		beego.NSRouter("/uploadChangeHead", &controllers.AccountUserController{}, "*:UploadChangeHead"),
		beego.NSRouter("/uploadTrueHead", &controllers.AccountUserController{}, "*:UploadTrueHead"),
		beego.NSRouter("/company", &controllers.AccountUserController{}, "*:Company"),
		beego.NSRouter("/editpwd", &controllers.AccountUserController{}, "*:EditPwd"),
	)
	beego.AddNamespace(accountUser)

	accountCompany := beego.NewNamespace("/acompany",
		beego.NSRouter("/", &controllers.AccountCompanyController{}, "*:Get"),
		beego.NSRouter("/company", &controllers.AccountCompanyController{}, "*:Company"),
		beego.NSRouter("/issuejob", &controllers.AccountCompanyController{}, "*:Issuejob"),
		beego.NSRouter("/editpwd", &controllers.AccountCompanyController{}, "*:EditPwd"),
	)
	beego.AddNamespace(accountCompany)

	// beego.Router("/", &controllers.HomeController{},"*:Get")
	// beego.Router("/login", &controllers.HomeController{},"*:Login")
	// beego.Router("/regedit", &controllers.HomeController{},"*:Regedit")
}
